home *** CD-ROM | disk | FTP | other *** search
- /* CMD: Rotate_On_Center
- * Rotate Object by it's center */
- /* Nir Hermoni, zapa@datasrv.co.il
- */
-
- libadd = addlib("LWModelerARexx.port",0)
- signal on error
- signal on syntax
-
- box=boundingbox() /* Should check out empty list ... */
- parse var box n x1 x2 y1 y2 z1 z2
- say box
- cx=(x2+x1)/2
- cy=(y2+y1)/2
- cz=(z2+z1)/2
-
- call req_begin "Rotate on object center"
-
- rotateID = req_addcontrol(" rotation","N",0)
- AxID = req_addcontrol(" Axis","CH",'X Y Z')
-
- call req_setval rotateID,0
- call req_setval AxID,1
-
- if (~req_post()) then do
- call req_end
- exit
- end
-
- rotation = req_getval(rotateID)
- rotaxis = req_getval(AxID)
-
- if rotaxis = 1 then rotaxis = 'X'
- if rotaxis = 2 then rotaxis = 'Y'
- if rotaxis = 3 then rotaxis = 'Z'
-
- call req_end()
-
- /* Uncomment this to ask if really perform
- line1 = ' Angle = 'rotation
- line2 = ' Axis = 'rotaxis
- ask_ok = "@Perform rotation? (undo to undo)"
-
- ok=NOTIFY(3,line1,line2,' ',ask_ok)
- if ok = 0 then exit
- *******************************************/
- call ROTATE(rotation,rotaxis,cx cy cz)
-
- if (libadd) then call remlib("LWModelerARexx.port")
- exit
-
- syntax:
- error:
- t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
- if (libadd) then call remlib("LWModelerARexx.port")
- exit
-